package com.ww.basic.fun.closure

object Test02 {
  def main(args: Array[String]): Unit = {
    var externalVar = 10
    val closure = (x: Int) => x + externalVar

    println(closure(5)) // 15

    externalVar = 20

    println(closure(5)) // 25
  }
}
